<template>
  <div>
      <headerMiddle title="更多跟帖"/>
      <comment :commentItem="item" v-for="(item,index) in comments" :key="index"/>
  </div>
</template>

<script>
import comment from '../components/comment';
import headerMiddle from '../components/headerMiddle'
export default {
    components:{
        comment,
        headerMiddle
    },
    data(){
        return{
            postId:this.$route.params.id,
            comments:[]
        }
    },
    mounted(){
        // 一进来就要根据postId获取评论数据
        this.$axios({
            url:'/post_comment/'+this.postId,
            method:'get'
        }).then(res=>{
            const {data} = res.data;
            this.comments = data
        })
    }
}
</script>

<style>

</style>